package panels;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;

import utils.imageButton;

public class BottomBar extends JPanel{
		private JButton addAppt, viewAgenda, options;
		// Put mobile device stuff in here
		public BottomBar(){
			// For centre mobile Panel.
			
			setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
			JPanel functionsPanel = new JPanel();
			functionsPanel.setLayout(new BoxLayout(functionsPanel, BoxLayout.X_AXIS));
			this.setBackground(Color.white);
			functionsPanel.setBackground(Color.white);
			//bottom bar
			
			addAppt = new imageButton("img/combo_plus_sign2.png",44,44); //  represented as "+" sign
		
			viewAgenda = new JButton("Agenda");
			//
	
		
			options = new imageButton("img/up_arrow_black.gif",44,44);
			// Add each of these buttons to a section of the content pane.
			functionsPanel.add(options,BorderLayout.WEST);
			functionsPanel.add(viewAgenda,BorderLayout.CENTER);
			functionsPanel.add(addAppt,BorderLayout.EAST);
			
			//viewPanel.setSize(700, 70); //align with outer container
			
			// Add handlers to view buttons
			FunctionsHandler apptHandler = new FunctionsHandler();
			FunctionsHandler agendaHandler = new FunctionsHandler();
			FunctionsHandler optionsHandler = new FunctionsHandler();
			
			// Assign handlers
			addAppt.addActionListener(apptHandler);
			viewAgenda.addActionListener(agendaHandler);
			options.addActionListener(optionsHandler);
			
			// Add view panel
			add(functionsPanel);
			
		}
		
		// Action Listeners for functions
		class FunctionsHandler implements ActionListener	{
			public void actionPerformed (ActionEvent ae) {
				//ignore this int, its needed because we dont have any statements in the ifs yet!
				int  dosomething = 0;
				if (ae.getSource() == addAppt)
					//goto day view
				if (ae.getSource() == viewAgenda)
					//goto week view	
				if (ae.getSource() == addAppt)
					dosomething++;
					//goto month view
			} 
		} 
}
